package spittr.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import spittr.service.UserService;

@Controller
@RequestMapping("/spitter")
public class SpitterController {
    @Autowired
    UserService service;

    @RequestMapping("/{username}")
    public String spitterInfo(@PathVariable("username") String username, Model model){
        model.addAttribute("spitter",service.findUser(username));
        return "spitterPage";
    }
}
